<!doctype html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<link href="../css/mui.min.css" rel="stylesheet" />
</head>
<body>
	<div class="mui-content">
	   	<form class="mui-input-group">
	   	    <div class="mui-input-row">
	   	        <input type="text" class="mui-input-clear" id="ads" style="width: 100%;" />
	   	    </div>
	   	</form>
	</div>
	
	
	
<script src="../js/mui.min.js"></script>
<script src="../js/bexta.js"></script>
<script type="text/javascript">
	mui.init({
		beforeback:function(){
			var v = document.querySelector('#ads').value;
			mui.fire(views.opener(), 'setMarkAndName', {
				val:v,
				sid:views.flag
			});
			return true;
		}
	})
	var nativeWebview, imm, InputMethodManager, views;
	var initNativeObjects = function() {
	    if (mui.os.android) {
	        var main = plus.android.runtimeMainActivity();
	        var Context = plus.android.importClass("android.content.Context");
	        InputMethodManager = plus.android.importClass("android.view.inputmethod.InputMethodManager");
	        imm = main.getSystemService(Context.INPUT_METHOD_SERVICE);
	    } else {
	        nativeWebview = plus.webview.currentWebview().nativeInstanceObject();
	    }
	};
	var showSoftInput = function() {
	    if (mui.os.android) {
	        imm.toggleSoftInput(0, InputMethodManager.SHOW_FORCED);
	    } else {
	        nativeWebview.plusCallMethod({
	            "setKeyboardDisplayRequiresUserAction": false
	        });
	    }
	    setTimeout(function() {
	       //此处可写具体逻辑设置获取焦点的input
	       var inputElem = document.querySelector('#ads');
	              inputElem.focus(); 
	    }, 200);
	};
	mui.plusReady(function () {
		views = bexta.getWebview();
		document.querySelector('#ads').value = views.def;
		mui.later(function(){
			initNativeObjects(); 
    			showSoftInput();
		},50);
	    
	})	
</script>
</body>
</html>